package com.axin.blog.api;


import com.axin.blog.api.domain.WebUser;
import com.axin.common.core.constant.ServiceNameConstants;
import com.axin.common.core.domain.web.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 客户端用户服务 远程调用
 *
 * @Author axin
 * @Date 2021/10/31 23:15
 */
@FeignClient(contextId = "remoteWebUserService", value = ServiceNameConstants.BLOG_SERVICE, path = "/webUser")
public interface RemoteWebUserService {


    /**
     * 通过用户名查询客户端用户
     *
     * @param username 用户名
     * @return 用户对象信息
     */
    @GetMapping("/infoByUsername/{username}")
    AjaxResult<WebUser> infoByUsername(@PathVariable("username") String username);

    @PostMapping("/register")
    AjaxResult register(@RequestBody WebUser user);

    /**
     * 记录登录信息
     *
     * @param user
     * @return
     */
    @PostMapping("/updateUserProfile")
    AjaxResult updateUserProfile(@RequestBody WebUser user);
}
